<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-11-11 14:20:20
         compiled from "H:\WebApplication\myconpany\sumi_mobile\application\views\user\userinfos.html" */ ?>
<?php /*%%SmartyHeaderCode:32627563acba54c47e7-69343849%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '70d39000ba5af15981b9742f27e4f5efaf85e7e6' => 
    array (
      0 => 'H:\\WebApplication\\myconpany\\sumi_mobile\\application\\views\\user\\userinfos.html',
      1 => 1447222670,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '32627563acba54c47e7-69343849',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.21-dev',
  'unifunc' => 'content_563acba58fcf25_08357344',
  'variables' => 
  array (
    'userinfo' => 0,
    'province' => 0,
    'item' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_563acba58fcf25_08357344')) {function content_563acba58fcf25_08357344($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ((@constant('APPLICATION_PATH')).("/application/views/header.html"), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<!--header stop-->
<?php echo $_smarty_tpl->getSubTemplate ((@constant('APPLICATION_PATH')).("/application/views/common/headerusertitle.html"), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<!--header end-->
<div class="wp_fixed" style="top:48px;">
<section class="wrap">
    <ul class="user_g">
        <li class="curr"><a href="/user/userinfos">用户信息</a></li>
        <li><a href="/user/company" >公司信息</a></li>
    </ul>
    <!--content stop-->
    <section class="shopping-wrap mt10p">

        <form method="post" action="/user/userinfos" >
        <ul class="to-c" style="background:#fff;">
            <!--<li><b class="rgt"></b><span class="user_tx">头　　像</span><span class="user_edit"></span></li>-->
            <li><span class="">用 户 名</span><span class="fr"  style="padding-right: 15px;"><?php echo $_smarty_tpl->tpl_vars['userinfo']->value['login_name'];?>
</span></li>
            <li><b class="rgt rgt_mt"></b><span class="">昵　　称</span><span class="fr" style="width: 78%;"><input value="<?php if ($_smarty_tpl->tpl_vars['userinfo']->value['realname']!='') {
echo $_smarty_tpl->tpl_vars['userinfo']->value['realname'];
}?>" name="realname" style="width: 98%; border: none; text-align: right; padding-right: 15px;" /></span></li>
            <li><b class="rgt rgt_mt"></b><span class="">性　　别</span><span class="fr" style="width: 78%; text-align: right; padding-right: 15px;">
            <label><input  type="radio" name="sex" value="M" style="border: 1px solid #666;  padding: 5px;" <?php if ($_smarty_tpl->tpl_vars['userinfo']->value['sex']=='M') {?>checked<?php }?> />男　</label>
            <label><input type="radio" name="sex" value="W" style="border: 1px solid #666;  padding: 5px;"  <?php if ($_smarty_tpl->tpl_vars['userinfo']->value['sex']=='W') {?>checked<?php }?> />女</label>
            </span></li>
            <li><b class="rgt rgt_mt"></b><span class="">QQ 号码</span><span class="fr" style="width: 78%;"><input value="<?php if ($_smarty_tpl->tpl_vars['userinfo']->value['qq']!='') {
echo $_smarty_tpl->tpl_vars['userinfo']->value['qq'];
}?>" name="qq" style="width: 98%; border: none; text-align: right; padding-right: 15px;" /></span></li>
            <li><b class="rgt rgt_mt"></b><span class="">手机号码</span><span class="fr" style="width: 78%;"><input value="<?php if ($_smarty_tpl->tpl_vars['userinfo']->value['moblie']!='') {
echo $_smarty_tpl->tpl_vars['userinfo']->value['moblie'];
}?>" name="moblie" style="width: 98%; border: none; text-align: right;  padding-right: 15px;" /></span></li>
            <li><b class="rgt rgt_mt"></b><span class="">　　邮箱</span><span class="fr"style="width: 78%;"><input value="<?php if ($_smarty_tpl->tpl_vars['userinfo']->value['email']!='') {
echo $_smarty_tpl->tpl_vars['userinfo']->value['email'];
}?>" name="email" style="width: 98%; border: none; text-align: right;  padding-right: 15px;" /></span></li>
            <li><b class="rgt rgt_mt"></b><span class="">　　座机</span><span class="fr"style="width: 78%;"><input value="<?php if ($_smarty_tpl->tpl_vars['userinfo']->value['tel']!='') {
echo $_smarty_tpl->tpl_vars['userinfo']->value['tel'];
}?>" name="tel" style="width: 98%; border: none; text-align: right;  padding-right: 15px;" /></span></li>
            <li><b class="rgt rgt_mt"></b><span class="">所 在 地</span><span class="fr"style="width: 78%; text-align: right;  padding-right: 15px;">
             <select class="se_m provice_id" name="province_id" style="width: 30%; border: none;">
             <option>请选择</option>
             <?php  $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['item']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['province']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
$_smarty_tpl->tpl_vars['item']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['item']->key;
?>
             <option value="<?php echo $_smarty_tpl->tpl_vars['item']->value['region_id'];?>
"<?php if ($_smarty_tpl->tpl_vars['userinfo']->value['province_id']==$_smarty_tpl->tpl_vars['item']->value['region_id']) {?>selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['item']->value['region_name'];?>
</option>
             <?php } ?>
            </select>
            <select class="se_m city_id" name="city_id" style="width: 30%; border: none; ">
                <option>请选择</option>
                <?php if ($_smarty_tpl->tpl_vars['userinfo']->value['city_name']!='') {?><option value="<?php echo $_smarty_tpl->tpl_vars['userinfo']->value['city_id'];?>
" selected><?php echo $_smarty_tpl->tpl_vars['userinfo']->value['city_name'];?>
</option><?php }?>
            </select>
            <select class="se_m area_id" name="area_id" style="width: 30%; border: none; ">
                <option>请选择</option>
                <?php if ($_smarty_tpl->tpl_vars['userinfo']->value['area_name']!='') {?><option value="<?php echo $_smarty_tpl->tpl_vars['userinfo']->value['area_id'];?>
" selected><?php echo $_smarty_tpl->tpl_vars['userinfo']->value['area_name'];?>
</option><?php }?>
            </select>
            </span></li>
            <li><b class="rgt rgt_mt"></b><span class="">详情地址</span><span class="fr"style="width: 78%; text-align: right; border: none; ">
                <input name="detail_addr" value="<?php if ($_smarty_tpl->tpl_vars['userinfo']->value['detail_addr']!='') {
echo $_smarty_tpl->tpl_vars['userinfo']->value['detail_addr'];
}?>" style="width: 98%;border: none; text-align: right;  padding-right: 15px;" /></span></li>
        </ul>
        <p class="sst-btn move-btn"><input type="submit" value="保存" class="purchase_w3 btn_em tac"></p>
        </form>
    </section>


    <!--content end-->



</section>
</div>
<!--content end-->



<?php echo '<script'; ?>
>
$(function(){
$(document).delegate(".provice_id", "change", function(e){
var proviceid = $(this).val();

if(proviceid=="请选择"){
return false;
}
var purl = "/region/getprovice";
$.ajax({
url: purl,//请求的地址
type:'post',
dataType: "json",//请求的数据格式
data: {
proviceid: proviceid //请求的数据
},
success: function(data) {
if(data=='-1'){
alert("请先选择省份!");return false;
}else{
$(".city_id option").remove();
var html = "<option>请选择</option>";
for(var k in data){
html +="<option value=\""+data[k].region_id+"\">"+data[k].region_name+"</option>";
}
$(".city_id").append(html);
}
}
});
});

$(document).delegate(".city_id", "change", function(e){
var city_id = $(this).val();
if(city_id=="请选择"){
alert("请先选择！"); return false;
}
var aurl = "/region/getarea";
$.ajax({
url: aurl,//请求的地址
type:'POST',
dataType: "json",//请求的数据格式
data: {
cityid: city_id //请求的数据
},
success: function(data) {
if(data=='-1'){
alert("请先选择城市!");return false;
}else{
$(".area_id option").remove();
var html = "<option>请选择</option>";
for(var k in data){
html +="<option value=\""+data[k].region_id+"\">"+data[k].region_name+"</option>";
}
$(".area_id").append(html);
}
}
});
});

$(".add_btn").click( function(e){
if(checkSubmitMobil($('input[name=mobile]'))==false||nEmpty($('input[name=conpany_name]'),'公司名称不能为空！','公司名称太长或太短,请重新输入！','公司名称不能为数字!','公司名称填写正确！')==false||
nEmpty($('input[name=username]'),'联系人不能为空！','联系人太长或太短,请重新输入!','联系人不能为数字!','联系人填写正确！')==false || nEmpty($('.detail_addr'),'收货地址不能为空！','收货地址太长或太短,请重新输入!','收货地址不能为数字!','收货地址填写正确！')==false){
return false;
}else{
var content = $("input[name=content]").val();
var conpany_name = $('input[name=conpany_name]').val();
var mobile = $('input[name=mobile]').val();
var username = $('input[name=username]').val();
var provice_id = $('.provice_id').val();
var city_id = $('.city_id').val();
var area_id = $('.area_id').val();
var detail_addr = $('.detail_addr').val();
var customer_remark = $('.customer_remark').val();
var product_id = $('#product_id').val();



$.ajax({
url:'/event/sample',
data:{content:content,conpany_name:conpany_name,mobile:mobile,username:username,provice_id:provice_id,city_id:city_id,area_id:area_id,detail_addr:detail_addr,customer_remark:customer_remark,product_id:product_id},
type:'POST',
success:function(data){
var data = eval("("+data+")");
if(data.code == '8'){
alert("申请成功！");
window.location.reload();

}else{
alert("申请不成功！");
window.location.reload();
}
return false;
},
dataType:'text'
});
}
});



function nEmpty(obj,txt1,txt2,txt3,txt4){
Value = obj.val();
if(Value==''){
obj.siblings('.empty').html("<font class='red pl10'>"+txt1+"</font>");
return false;
}else if(Value.length<=2||Value.length>=60){
obj.siblings('.empty').html("<font class='red pl10'>"+txt2+"</font>");
return false;
}else if(!isNaN(obj.val())){
obj.siblings('.empty').html("<font class='red pl10'>"+txt3+"</font>");
return false;
}else{
obj.siblings('.empty').html("<font class='green pl10'>"+txt4+"</font>");
return true;
}
}

function checkSubmitMobil(obj){
if(obj.val()==""){
obj.siblings('.empty').html("<font class='red pl10'>手机号码不能为空！</font>");
return false;
}
if(!obj.val().match(/^(?:13\d|15\d|18\d)\d{5}(\d{3}|\*{3})$/)){
obj.siblings('.empty').html("<font class='red pl10'>手机号码格式不正确,请重新输入！</font>");
return false;
}else{
obj.siblings('.empty').html("<font class='green pl10'>手机号码正确！</font>");
return true;
}
}

$('input[name=conpany_name]').blur(function(){
nEmpty($('input[name=conpany_name]'),'公司名称不能为空！','公司名称太长或太短,请重新输入！','公司名称不能为数字!','公司名称填写正确！');
});

$('input[name=username]').blur(function(){
nEmpty($('input[name=username]'),'联系人不能为空！','联系人太长或太短,请重新输入!','联系人不能为数字!','联系人填写正确！');
});

$('input[name=mobile]').blur(function(){
checkSubmitMobil($('input[name=mobile]'));
});

$('.detail_addr').blur(function(){
nEmpty($('.detail_addr'),'收货地址不能为空！','收货地址太长或太短,请重新输入!','收货地址不能为数字!','收货地址填写正确！');
});
});
<?php echo '</script'; ?>
>

<?php echo $_smarty_tpl->getSubTemplate ((@constant('APPLICATION_PATH')).("/application/views/footer.html"), $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<?php }} ?>
